package cn.helper;

import android.util.Log;
import com.unity3d.player.UnityPlayer;
import java.io.IOException;
import java.io.InputStream;

public class StreamingAssetsSync {

	private static final String TAG = "BToolkit";

	public static byte[] getBytes(String filePath) {
		try {
			// 判断文件夹是否存在
			InputStream is = UnityPlayer.currentActivity.getAssets().open(filePath);
			int size = is.available();
			byte[] buffer = new byte[size];
			is.read(buffer);
			is.close();
			return buffer;
		} catch (IOException e) {
			Log.i(TAG, e.getMessage());
		}
		return null;
	}

}
